<?php

use think\migration\Seeder;

class TodoListTableSeeder extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run()
    {
        $rows = [];
        for($i = 1; $i <= 10; $i ++){
            $rows[] = [
                'user_id' => 1,
                'title' => '待办事项：' . $i,
                'job' => mt_rand(0,1),
                'create_time' => date('Y-m-d H:i:s'),
                'update_time' => date('Y-m-d H:i:s'),
            ];
        };
        $this->table('todo_list')->insert($rows)->save();
    }
}